<?php
$this->breadcrumbs = array(
	'员工列表' => array(
		'index'
	),
	$model->fullName,
);

if (Yii::app()->user->checkAccess('employeeManage')) {
	$this->userActions = array(
		array(
			'label' => '编辑员工',
			'url' => array(
				'update',
				'id' => $model->id
			),
			'iconClass' => 'icon-user-edit',
		),
		array(
			'label' => '管理证书',
			'url' => array(
				'employeeCertificate/admin',
				'employeeId' => $model->id
			),
			'iconClass' => 'icon-user-edit',
		),
		array(
			'label' => '删除员工',
			'url' => '#',
			'linkOptions' => array(
				'submit' => array(
					'delete',
					'id' => $model->id
				),
				'confirm' => '确定要删除这个员工？'
			),
			'iconClass' => 'icon-user-delete',
		),
		array(
			'label' => '员工管理',
			'url' => array(
				'admin',
			),
			'iconClass' => 'icon-user',
		),
	);
}
?>

<h1>查看员工 <?php echo $model->fullName; ?></h1>
<?php $booleans = JHTML::getBooleanValues(); ?>
<div class="view-details">
<div class="section-title">总览</div>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('status')); ?>
	</span>
	<span class="span-3">
		<?php echo $model->getAttribute('employed') ? '在职' : '不在职'; ?>
		（<?php echo $model->getStatusText(); ?>）
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('documentNumber')); ?>
	</span>
	<span class="span-4">
		<?php echo $model->documentNumber; ?>
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('currentProjectId')); ?>
	</span>
	<span class="span-4">
		<?php echo $model->currentProjectName; ?>
	</span>
<div class="clear"></div>
<div class="section-title">基本情况</div>
	<div class="span-14">
	<span class="span-3 label">
		姓名
	</span>
	<span class="span-3">
		<?php echo CHtml::encode($model->getFullName()); ?>
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('gender')); ?>
	</span>
	<span class="span-3">
		<?php echo JHTML::getGender($model->gender);
		?>
	</span>

	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('ethnicGroup')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'ethnicGroup');
		?>
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('homeTown')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'homeTown'); ?>
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('education')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'education'); ?>
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('profession')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'profession'); ?>
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('dateOfBirth')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'dateOfBirth'); ?>
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('healthCondition')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'healthCondition'); ?>
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('hireDate')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'hireDate'); ?>
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('maritalStatus')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'maritalStatus'); ?>
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('currentRank')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'currentRank'); ?>
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('politicalStatus')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'politicalStatus'); ?>
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('contactMobile')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'contactMobile'); ?>
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('contactPhone')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'contactPhone'); ?>
	</span>
	
</div>

	<div class="span-4 last">
		<?php if ($model->personalPhotoThumb) {
			echo CHtml::link(
				CHtml::image(
					Yii::app()->baseUrl . '/uploads/employeePhoto/tn/' . $model->personalPhotoThumb),
				Yii::app()->baseUrl . '/uploads/employeePhoto/' . $model->personalPhotoFile,
				array(
					'target' => '_blank'
				));
		}
		?>
	</div>
<div class="clear"></div>

	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('originalHomeAddress')); ?>
	</span>
	<span class="span-15">
		<?php echo JHtml::value($model, 'originalHomeAddress'); ?>
	</span>
<div class="clear"></div>
	
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('currentAddress')); ?>
	</span>
	<span class="span-15">
		<?php echo JHtml::value($model, 'currentAddress'); ?>
	</span>
<div class="clear"></div>

	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('emergencyContactName')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'emergencyContactName'); ?>
	</span>

	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('emergencyContactPhone')); ?>
	</span>
	<span class="span-5">
		<?php echo JHtml::value($model, 'emergencyContactPhone'); ?>
	</span>
<div class="clear"></div>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('identityCardNumber')); ?>
	</span>
	<span class="span-15">
		<?php echo JHtml::value($model, 'identityCardNumber'); ?>
	</span>
<div class="clear"></div>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('graduationSchool')); ?>
	</span>
	<span class="span-15">
		<?php echo JHtml::value($model, 'graduationSchool'); ?>
	</span>
<div class="clear"></div>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('certificates')); ?>
	</span>
	<span class="span-15">
		<?php echo JHtml::value($model, 'certificates'); ?>
	</span>
<div class="clear"></div>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('personalHabits')); ?>
	</span>
	<span class="span-15">
		<?php echo JHtml::value($model, 'personalHabits'); ?>
	</span>
<div class="clear"></div>

<div class="section-title">目前福利保险</div>
	<span class="span-3">
		<span class="label"><?php echo CHtml::encode(
								$model->getAttributeLabel('personalSocialPension'));
							?>：</span>
		<?php echo JHtml::value($model, 'personalSocialPension', 'boolean'); ?>
	</span>
	<span class="span-3">
		<span class="label"><?php echo CHtml::encode(
								$model->getAttributeLabel('personalSocialInjury'));
							?>：</span>
		<?php echo JHtml::value($model, 'personalSocialInjury', 'boolean'); ?>
	</span>
	<span class="span-3">
		<span class="label"><?php echo CHtml::encode(
								$model->getAttributeLabel('personalSocialUemployed'));
							?>：</span>
		<?php echo JHtml::value($model, 'personalSocialUemployed', 'boolean'); ?>
	</span>

	<span class="span-3">
		<span class="label"><?php echo CHtml::encode(
								$model->getAttributeLabel('personalSocialIllness'));
							?>：</span>
		<?php echo JHtml::value($model, 'personalSocialIllness', 'boolean'); ?>
	</span>

	<span class="span-3">
		<span class="label"><?php echo CHtml::encode(
								$model->getAttributeLabel('personalSocialInsurance'));
							?>：</span>
		<?php echo JHtml::value($model, 'personalSocialInsurance', 'boolean'); ?>
	</span>
<div class="clear"></div>

<div class="section-title">其它基本情况</div>
	<div class="label">
		<?php echo CHtml::encode($model->getAttributeLabel('familyMembers')); ?>
	</div>
	<div><?php echo JHtml::value($model, 'familyMembers'); ?>
	</div>

	<div class="label">
		<?php echo CHtml::encode($model->getAttributeLabel('educationDetails')); ?>
	</div>
	<div><?php echo JHtml::value($model, 'educationDetails'); ?>
	</div>

	<div class="label">
		<?php echo CHtml::encode($model->getAttributeLabel('workExperience')); ?>
	</div>
	<div><?php echo JHtml::value($model, 'workExperience'); ?>
	</div>
	<div class="label">
		<?php echo CHtml::encode($model->getAttributeLabel('outstandingAchievement')); ?>
	</div>
	<div><?php echo JHtml::value($model, 'outstandingAchievement'); ?>
	</div>
	<div class="label">
		<?php echo CHtml::encode($model->getAttributeLabel('note')); ?>
	</div>
	<div><?php echo JHtml::value($model, 'note'); ?>
	</div>

<div class="section-title">用工情况</div>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('trialDate')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'trialDate'); ?>
	</span>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('trialSalary')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'trialSalary'); ?>
	</span>
	<div class="clear"></div>
	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('employedDate')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'employedDate'); ?>
	</span>

	<span class="span-3 label">
		<?php echo CHtml::encode($model->getAttributeLabel('unemployedDate')); ?>
	</span>
	<span class="span-3">
		<?php echo JHtml::value($model, 'unemployedDate'); ?>
	</span>
	<div class="clear"></div>

	<span class="span-4">
		<span class="label"><?php echo CHtml::encode($model->getAttributeLabel('signedCommitment')); ?>：</span>
		<?php echo JHtml::value($model, 'signedCommitment', 'boolean'); ?>
	</span>
	<span class="span-4">
		<span class="label"><?php echo CHtml::encode(
								$model->getAttributeLabel('signedSecrecyAgreement'));
							?>：</span>
		<?php echo JHtml::value($model, 'signedSecrecyAgreement', 'boolean'); ?>
	</span>
	<span class="span-4">
		<span class="label"><?php echo CHtml::encode(
								$model->getAttributeLabel('signedTrailContract'));
							?>：</span>
		<?php echo JHtml::value($model, 'signedTrailContract', 'boolean'); ?>
	</span>
	<div class="clear"></div>
	
	<span class="span-4">
		<span class="label"><?php echo CHtml::encode(
								$model->getAttributeLabel('signedEmploymentContract'));
							?>：</span>
		<?php echo JHtml::value($model, 'signedEmploymentContract', 'boolean'); ?>
	</span>

	<span class="span-4">
		<span class="label"><?php echo CHtml::encode(
								$model->getAttributeLabel('signedGuaranteeStatement'));
							?>：</span>
		<?php echo JHtml::value($model, 'signedGuaranteeStatement', 'boolean'); ?>
	</span>

	<span class="span-4">
		<span class="label"><?php echo CHtml::encode(
								$model->getAttributeLabel('signedJobStatement'));
							?>：</span>
		<?php echo JHtml::value($model, 'signedJobStatement', 'boolean'); ?>
	</span>

	<div class="clear"></div>
	<div class="label">
		<?php echo CHtml::encode($model->getAttributeLabel('companyNote')); ?>
	</div>
	<div><?php echo JHtml::value($model, 'companyNote'); ?>
	</div>
<div>
<div class="section-title">证书</div>
<?php
$this
	->widget('zii.widgets.CListView',
		array(
			'dataProvider' => new CArrayDataProvider($model->certificateItems,
				array(
					'pagination' => false
				)),
			'itemView' => '_viewCertificate',
			//			'viewData' => array(
			//				'booleans' => JHTML::getBooleanValues(),
			//			),
			//'separator' => '<div class="list-item-separator"></div>'
		));
?>
</div>
<div class="clear"></div>
<?php
$this->renderPartial('_viewEmployeeTags', array(
		'model' => $model
	));
?>

</div>
